package com.jh.hts_jdk.io;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import htsjdk.samtools.reference.*;

public class Fasta {
    public static List<ReferenceSequence> getFastaSequences(File file){
        FastaSequenceFile fasta_reader = new FastaSequenceFile(file, true);
        List<ReferenceSequence> seq_list = new ArrayList<>();
        ReferenceSequence sequence;
        while ((sequence = fasta_reader.nextSequence())!=null) {
            seq_list.add(sequence);
        }
        fasta_reader.close();
        return seq_list;
    }
}
